﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;

namespace OCR
{

    /// <summary>
    /// 配置信息
    /// </summary>
    public class OcrConfigInfo
    {
        /// <summary>
        /// 配置方案名称
        /// </summary>
        public string ConfigName
        {
            get;
            set;
        }
       
        private string font = "eng";
        /// <summary>
        /// 字体
        /// </summary>
        public string Font
        {
            get
            {
                return this.font;
            }
            set
            {
                this.font = value;
            }
        }
        private bool recognitionNum = true;
        public bool RecognitionNum
        {
            get
            {
                return this.recognitionNum;
            }
            set
            {
                this.recognitionNum = value;
            }
        }

        public bool RecognitionChar
        {
            get;
            set;
        }
        /// <summary>
        /// 识别字符串范围
        /// </summary>
        public string RecognitionStr
        {
            get
            {
                string tempStr = "";
                if (this.RecognitionNum)
                {
                    tempStr = "0123456789";
                }
                if (this.RecognitionChar)
                {
                    tempStr += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
                }
                return tempStr;
            }
        }
        public int PwLeft
        {
            get;
            set;
        }

        public int PwTop
        {
            get;
            set;
        }

        public int PwWidth
        {
            get;
            set;
        }

        public int PwHeight
        {
            get;
            set;
        }

        public int NoLeft
        {
            get;
            set;
        }

        public int NoTop
        {
            get;
            set;
        }

        public int NoWidth
        {
            get;
            set;
        }

        public int NoHeight
        {
            get;
            set;
        }


        public int PwCount
        {
            get;
            set;
        }

        public int NoCount
        {
            get;
            set;
        }
        public Rectangle NoRec
        {
            get
            {
                return new Rectangle(this.NoLeft, this.NoTop, this.NoWidth, this.NoHeight);
            }
            set
            {
                this.NoLeft = value.X;
                this.NoTop = value.Y;
                this.NoWidth = value.Width;
                this.NoHeight = value.Height;
            }
        }
        public Rectangle PasswordRec
        {
            get
            {
                return new Rectangle(this.PwLeft, this.PwTop, this.PwWidth, this.PwHeight);
            }
            set
            {
                this.PwLeft = value.X;
                this.PwTop = value.Y;
                this.PwWidth = value.Width;
                this.PwHeight = value.Height;
            }
        }
        private BinarizationMethods binarizationMethod = BinarizationMethods.Otsu;
        /// <summary>
        /// 图片二值化方法
        /// </summary>
        public BinarizationMethods BinarizationMethod
        {
            get
            {
                return this.binarizationMethod;
            }
            set
            {
                this.binarizationMethod = value;
            }
        }
        private bool removeHotPixel = true;
        /// <summary>
        /// 是否去噪点
        /// </summary>
        public bool RemoveHotPixel
        {
            get { return removeHotPixel; }
            set { removeHotPixel = value; }
        }
        /// <summary>
        /// 运营商
        /// </summary>
        public string OperatorsName
        {
            get;
            set;
        }

        /// <summary>
        /// 面值
        /// </summary>
        public string FaceValue
        {
            get;
            set;
        }
        /// <summary>
        /// 有效期
        /// </summary>
        public DateTime ValidDate
        {
            get;
            set;
        }
    }
}
